package cn.qinyun.cloud.core.cloud.config;

/**
 * 类名称：RequestConfiguration <br>
 * 类描述：TODO <br>
 *
 * @author 张兆发
 * @date 创建时间：2021/7/16  4:05 下午 <br>
 * @version 1.0.0
 */

import cn.qinyun.cloud.core.cloud.filter.TenantContextHolderFilter;
import cn.qinyun.cloud.core.cloud.filter.TraceFilter;
import cn.qinyun.cloud.core.cloud.props.MateRequestProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 请求配置，包括tracId和其他网络请求
 *
 * @author pangu
 */
@Configuration
@EnableConfigurationProperties(MateRequestProperties.class)
public class RequestConfiguration {

    @Bean
    public TenantContextHolderFilter tenantContextHolderFilter() {
        return new TenantContextHolderFilter();
    }

    @Bean
    public TraceFilter traceFilter() {
        return new TraceFilter();
    }

}
